// 导入Vue
import Vue from "vue";

// 定义混入代码
Vue.mixin({
  // ...
  methods: {
    jump(url) {
      if (this.$route.path === url) return;
      this.$router.push(url);
    },
    confirm(successCallback, errorCallback) {
      this.$confirm("此操作将永久删除该文件, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          // this.$message.success("删除成功");
          successCallback();
        })
        .catch(() => {
          if (errorCallback) {
            errorCallback();
          } else {
            this.$message.info("已取消删除");
          }
        });
    },
  },
  // ...
});
